From: Stefan Monnier Date: Tue, 2 Aug 2011 16:02:52 +0000 (-0400) Subject: * src/keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~2661 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=13b677ffc8de1762cf7c08115bd5fa7baee9700c;p=emacs.git * src/keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE. --- diff --git a/src/ChangeLog b/src/ChangeLog index 835b9137e24..0735299d370 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-08-02 Stefan Monnier + + * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE. + 2010-12-03 Don March * keymap.c (Fdefine_key): Fix non-prefix key error message when diff --git a/src/keymap.c b/src/keymap.c index 03688abfe4c..c461fdddbbc 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1217,16 +1217,9 @@ binding KEY to DEF is added at the front of KEYMAP. */) keymap = get_keymap (cmd, 0, 1); if (!CONSP (keymap)) { - char trailing_esc[5]; - if (c == meta_prefix_char && metized) - { - if (idx == 0) - strcpy(trailing_esc, "ESC"); - else - strcpy(trailing_esc, " ESC"); - } - else - strcpy(trailing_esc, ""); + const char *trailing_esc = ((EQ (c, meta_prefix_char) && metized) + ? (idx == 0 ? "ESC" : " ESC") + : ""); /* We must use Fkey_description rather than just passing key to error; key might be a vector, not a string. */